package com.codemobiles.droidslator.activity;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.Window;
import android.view.View.OnTouchListener;
import android.widget.ImageView;

import com.codemobiles.droidslator.R;

public class ContactUsActivity extends Activity {
	private ImageView imgBanner;
	private ImageView backBtn;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.contact);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
				R.layout.custom_title);

		imgBanner = (ImageView) findViewById(R.id.imgBanner);
		backBtn = (ImageView) findViewById(R.id.imgBack);

		imgBanner.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				Uri uri = Uri.parse(getString(R.string.our_website));
				startActivity(new Intent(Intent.ACTION_VIEW, uri));
			}
		});

		backBtn.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				finish();
			}
		});
		backBtn.setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				int eventaction = event.getAction();

				switch (eventaction) {

				case MotionEvent.ACTION_DOWN:
					backBtn.setImageResource(R.drawable.button_back_touch);
					break;

				case MotionEvent.ACTION_MOVE:
					break;

				case MotionEvent.ACTION_UP:
					backBtn.setImageResource(R.drawable.button_back);
					break;
				}

				return false;
			}
		});
	}
}
